require(["frontmain"], function () {
    require(["jquery", "jquery.bxslider", "layer", "base", "front", "store.min"], function () {
        store = require("store.min");
        var e = {
            _init: function () {
                function e() {
                    if (n)var t = Math.floor(Math.random() * a) + 1; else var t = s;
                    var o = $(".content.join .change-image"), c = "url(http://image.thinkinggame.cn/img/2.0/join/bg-" + t + ".jpg)", r = $(".bg-text-change"), l = [{
                        en: "“They need to find nuggets of truth in data and then explain it to the Business leaders”",
                        zh: "“他们需要从数据中找到有用的真相，然后解释给领导者。”  ",
                        name: " ——Richard Snee "
                    }, {
                        en: "“Data Scientist = statistician + programmer + coach + storyteller + artist”",
                        zh: "“数据科学家=统计学家+程序员+讲故事的人+艺术家。“ ",
                        name: "– Shlomo Aragmon"
                    }, {
                        en: "“The data scientist was called, only half-jokingly, a caped superhero”",
                        zh: "“数据科学家曾经被誉为戴着披风的超级英雄（当然只是开个玩笑）”",
                        name: "– Ben Rooney"
                    }];
                    o.fadeOut(2 * i), setTimeout(function () {
                        setTimeout(function () {
                            r.find(".eng-text").text(l[t - 1].en).next().text(l[t - 1].zh).next().text(l[t - 1].name)
                        }, i), o.css({"background-image": c, "background-size": "100%"}).fadeIn(2 * i)
                    }, 2 * i), s == a ? s = 1 : s += 1, setTimeout(e, 6 * i)
                }

                B_Login._check(), S_HeadFoot._getHead();
                var o = B_Common._getUrl("controller");
                switch (o) {
                    case"acdetail":
                        S_HeadFoot._htmlPaper();
                        break;
                    case"":
                    case"index":
                        S_HeadFoot._htmlPaper(), $("#marquee").bxSlider({
                            mode: "horizontal",
                            infiniteLoop: !0,
                            displaySlideQty: 1,
                            moveSlideQty: 1,
                            captions: !1,
                            auto: !0,
                            controls: !1,
                            pause: 8e3,
                            speed: 1e3
                        }), t._goApp(), t._goDemo(), t._goVisit();
                        break;
                    case"company":
                        $("#aboutusBanner ").show(), $("#marquee").bxSlider({
                            mode: "horizontal",
                            displaySlideQty: 1,
                            moveSlideQty: 1,
                            captions: !0,
                            auto: !1,
                            controls: !0,
                            speed: 1e3,
                            pager: !1
                        });
                        break;
                    case"join":
                        $("#joinBanner ").show(), $("#marquee").bxSlider({
                            mode: "horizontal",
                            displaySlideQty: 1,
                            moveSlideQty: 1,
                            captions: !1,
                            auto: !0,
                            controls: !1,
                            speed: 1e3
                        });
                        var a = 3, n = !1, i = 800, s = 1;
                        e();
                        break;
                    case"price":
                        S_HeadFoot._htmlPaper(), $(".tf-tab-change li").on("click", function () {
                            var e = $(this).attr("href");
                            $(".tf-tab-change li").removeClass("selected"), $(this).addClass("selected"), $(".content").css("display", "none"), $(e).css("display", "block"), $("#unBindTab").unbind()
                        }), t._goOpen(), t._goDemo(), t._goQq(), t._goReg();
                        break;
                    case"operation":
                        t._goApp("operate"), t._goDemo();
                        break;
                    case"datacenter":
                        t._goApp("inside"), t._goDemo();
                        break;
                    case"analysis":
                        t._goOpen(), t._goDemo(), t._goTab();
                        break;
                    case"radar":
                        t._goDemo();
                        break;
                    case"professional":
                        t._goQq(), t._goDemo();
                        break;
                    case"datasolution":
                    case"analysissolution":
                    case"popluarsolution":
                        t._goQq(), t._goVisit()
                }
            }
        }, t = {
            _goTab: function () {
                $(".tf-tab-change li").each(function (e) {
                    $(this).click(function () {
                        $(this).hasClass("selected") || ($(this).addClass("selected").siblings().removeClass("selected"), $(".tf-tab-change-content .content").eq(e).show().siblings().hide())
                    })
                })
            }, _goReg: function () {
                $(".bs_reg_app").each(function () {
                    $(this).click(function () {
                        B_User._isDemoUser() ? B_Jump._go("target", "reg") : B_Jump._go("target", "main")
                    })
                })
            }, _goApp: function (e) {
                $(".bs_app_app").each(function () {
                    $(this).click(function () {
                        e || (e = $(this).attr("data-t")), B_Login._openProbation(e)
                    })
                })
            }, _goOpen: function () {
                $(".bs_open_app").each(function () {
                    $(this).click(function () {
                        S_User._freeApp()
                    })
                })
            }, _goVisit: function () {
                $(".bs_visit_app").each(function () {
                    $(this).click(function () {
                        var e = $(this).attr("data-t");
                        B_Jump._go("target", e)
                    })
                })
            }, _goDemo: function () {
                $(".bs_demo_app").each(function () {
                    $(this).click(function () {
                        var e = $(this).attr("data-t"), t = "outside" == e.substr(0, 7);
                        if (t) {
                            switch (e) {
                                case"outsidegameSummary":
                                case"outsidegameSentiment":
                                case"outsidegameForum":
                                    e = e.replace("outside", "")
                            }
                            "outsideCenter" != e && "outsideRankSentiment" != e && B_User._isDemoUser() ? B_Login._openLogin(e) : B_Jump._go("target", e)
                        } else B_Jump._go("base", B_Jump._getUrl("demo", {demo: e}))
                    })
                })
            }, _goQq: function () {
                $(".bs_qq_app").each(function () {
                    $(this).click(function () {
                        B_Jump._go("openUrl", B_Common._qqUrl())
                    })
                })
            }
        };
        e._init()
    })
});